<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<%@ taglib prefix="t" uri="/easyui-tags"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="css/index.css">
<link rel="stylesheet" href="css/shezhi.css">
<link rel="stylesheet" href="css/xiaoxi.css">
<title>好 友</title>
</head>
<!--头部 -->
<%@include file="head.jsp"%>

<!--main -->
<div class="shezhi">
	<div class="shezhi_c">
		<div class="shezhi_c_top">
			<img src="imges/home.png"> > 我的 > 好友
		</div>
		<div class="shezhi_con" style="height: auto;">
			<table style="width: 100%; table-layout: fixed;" cellpadding="0" cellspacing="0">
				<tbody>

					<td style="border-right: 1px solid #f1f1f1; width: 200px">
						<div class="shezhi_con_l" style="height: auto; border: none">
							<div class="shezhi_con_ltop">
								<span style="margin-top: 10px; display: inline-block"> <img class="shezhi_con_l_img" src="imges/jiayuan_tou.png"></span><br> <span>ID
									${mbId} <img src="imges/v1.jpg">
								</span>
							</div>
							<div class="shezhi_con_lc">
								<%@include file="friendLeftNavi.jsp"%>
							</div>
							<div style="clear: both"></div>
						</div>
					</td>

					<td>
						<form action="FriendController.do?delBuddy" method=post>
							<div class="shezhi_con_r" style="height: auto; padding-bottom: 10px">
								<div class="shezhi_con_rtop">
									<div class="search_lx">

										<%@include file="friendTopNavi.jsp"%>

										<ul style="float: right; margin-right: 20px;">
											<li>
												<input type="checkbox" id="checkall" name="checkall" onclick="checkAll(checkall)" />
												<span style="color: #ff6600">
													<button type="submit">删除</button>
												</span>
											</li>
										</ul>
									</div>
								</div>

								<div class="search_gj">




									<c:forEach items="${listsFriend}" var="listFriend" varStatus="status">
										<c:if test=" ${status.count%3==1} ">
											<dir>
										</c:if>
										<div class="search_bg">
											<div class="search_bg_img">
												<!-- 点好友跳转 到他的 个人中心 -->
												<c:if test="${backType eq 'friendLists' }">
													<img src="imges/message/touxiang.png">
												</c:if>
											</div>
											<div class="search_bg_con">
												<span style="color: #000"> <!-- 点好友跳转 到他的 个人中心 --> <a href=""></a>${listFriend.user_name}
												</span><br> <span>${listFriend.signature}</span><br>
												<input type="checkbox" style="float: right" name="info" id="${listFriend.id}" value="${listFriend.id}">
											</div>
										</div>
										<c:if test="${status.count%3==0}">
											</dir>
										</c:if>
										<c:set var=" v_count " value=" ${status.count} " />
									</c:forEach>
									<c:if test=" ${v_count%3==1} ">
										<div class="search_bg"></div>
										<div class="search_bg"></div>
								</div>
								</c:if>
								<c:if test=" ${v_count%3==2} ">
									<div class="search_bg"></div>
								</c:if>
							</div>

						</form>


						</div>

						<!-- 》》》》》》》》》》  分页 《《《《《《《《《《《 -->
						<div class="hd_page" style="padding-bottom: 20px">
							<!-- 分页 -->
							<div class="_page">
								<%
									int pageNo = 0, bfNo = 0;
									String pageNoStr = request.getParameter("page");
									if (StringUtil.isEmpty(pageNoStr) || "1".equals(pageNoStr)) {
										pageNo = 1;
										bfNo = 1;
									} else {
										pageNo = Integer.parseInt(pageNoStr);
										bfNo = pageNo - 1;
									}
									String annCount = request.getAttribute("pageCount").toString();
									int P_pageCount = Integer.parseInt(annCount);
								%>
								<span id="info">共${pageCount }页|第<%=pageNo%>页
								</span>
								<a href="FriendController.do?friendLists&page=1">首页</a>
								<a href="FriendController.do?friendLists&page=<%=bfNo%>">上一页</a>
								<%
									int showPages = 6;//显示10页
									if (showPages >= P_pageCount) {
										for (int i = 0; i < P_pageCount; i++) {
								%>
								<a class="<%=pageNo == (i + 1) ? "current" : ""%>" href="FriendController.do?friendLists&page=<%=(i + 1)%>"><%=(i + 1)%></a>
								<%
									}
									} else {
										int pindex = 0;
										if (pageNo > (showPages / 2))
											pindex = pageNo - (showPages / 2);
										if ((pageNo > P_pageCount - (showPages / 2))
												&& (pageNo <= P_pageCount))
											pindex = P_pageCount - showPages;
										for (int i = pindex; i < showPages + pindex; i++) {
								%>
								<a class="<%=pageNo == (i + 1) ? "current" : ""%>" href="FriendController.do?friendLists&page=<%=(i + 1)%>"><%=(i + 1)%></a>
								<%
									}
									}
								%>
								<a href="FriendController.do?friendLists&page=<%=(pageNo + 1)%>">下一页</a>
								<a href="FriendController.do?friendLists&page=<%=P_pageCount%>">尾页</a>
							</div>
						</div>
						<!-- 》》》》》》》》》》  分页 《《《《《《《《《《《 -->
					</td>

				</tbody>


			</table>
			<div style="clear: both"></div>
		</div>
		<div style="clear: both"></div>
	</div>
</div>

<!--foot -->
<%@include file="foot.jsp"%>

</body>
</html>
<script type="text/javascript">
	function checkAll(checkall) {
		arr = document.getElementsByName('info');
		if (checkall.checked == true) {
			for (i = 0; i < arr.length; i++) {

				arr[i].checked = true;
			}

		} else {
			for (i = 0; i < arr.length; i++) {
				if ((arr[i]).checked == false) {
					arr[i].checked = true;
				} else {
					arr[i].checked = false;
				}
			}
		}
	}
</script>
